import time

from selenium import webdriver
from selenium.webdriver.common.by import By
#文本输入与清除
# driver=webdriver.Chrome()
# driver.get("http://www.baidu.com")
# driver.maximize_window()
# element = driver.find_element(By.CSS_SELECTOR, "#kw")
# element.send_keys("python")
# time.sleep(3)
# element.clear()
# element.send_keys("nekopara")
# time.sleep(3)
# 文本提交
driver=webdriver.Chrome()
driver.get("http://www.bilibili.com")
driver.find_element(By.XPATH,"//*[@id='sb_form_q']").send_keys('萌娘百科')
time.sleep(2)
driver.find_element(By.XPATH,"//*[@id='sb_form_go']").submit()
time.sleep(3)